package com.atguigu.task.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author admin
 * @create 2020-06-07 16:22
 */
@Service
public class AsyncService {

    @Async //告诉spring这是一个异步方法,自动创建线程池管理注解
    public void hello(){
        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("处理数据中...");
    }
}
